package dao;

import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;
import pojo.StuScoreM;

import java.util.List;


@Repository
public interface StuScoreMMapper {

    @Select("select * from stu_score_m where name like #{name}")
    List<StuScoreM> getAll(String name);

    @Select("select * from stu_score_m where id = #{id}")
    StuScoreM getOne(String id);


    @Insert("insert into stu_score_m (id,exam_type,stu_id,term,major,name,course_grade) " +
            "values(#{id},#{examType},#{stuId},#{term},#{major},#{name},#{courseGrade})")
    int addScore(StuScoreM stuScoreM);

    @Update("update stu_score_m set exam_type=#{examType},term=#{term},major=#{major},name=#{name},course_grade=#{courseGrade} where stu_id=#{stuId}")
    int updateScore(StuScoreM stuScoreM);


    @Delete("delete from stu_score_m where id=#{id}")
    int deleteScore(String id);


    @Select("select * from stu_score_m")
    List<StuScoreM> getAllByArray();


}
